package com.myhome.money.base.test;

import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @author Rod
 */
public class Demo {
    public static void main(String[] args) {

        retain();
        //timestamp();
    }

    private static void strSplit() {
        String str = "1";
        String[] strArr = str.split(",");
        for (String s : strArr) {
            System.out.println(s);
        }
    }

    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    private static void timestamp() {
        long stamp = 1532572521151L;
        Date date = new Date(stamp);
        System.out.println(System.currentTimeMillis());
        System.out.println(sdf.format(date));

    }

    private static void retain() {
        Set<String> set01 = new HashSet(8);
        set01.add("a");
        set01.add("b");
        set01.add("c");
        Set<String> set02 = new HashSet(8);
        set02.add("d");
        set02.add("b");
        set02.add("c");
        //set01.retainAll(set02);

        Set<String> set001 = new HashSet<>(set01);
        //Collections.copy(set001, new ArrayList<>(set01));
        set001.add("aa4");
        System.out.println(set001);
        System.out.println(set01);
        System.out.println(set02);

    }
}
